package cn.tedu.dimanage.message.webapi;


import cn.tedu.dimanage.message.service.IMessageService;
import cn.tedu.dimanage.message.webapi.mapper.MessageMapper;
import cn.tedu.dimanage.pojo.dto.MessageDTO;
import cn.tedu.dimanage.pojo.vo.MessageVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.List;

@SpringBootTest
public class testService {

    @Autowired
    IMessageService service;
    @Autowired
    MessageMapper messageMapper;

    @Test
    public void addMessageParent(){
        MessageDTO messageDTO = new MessageDTO();

        messageDTO.setParentId(5L);
        messageDTO.setUserId(3L);

        messageDTO.setMessage("fdslhsdkjyfksh");
        service.addMessageParent(messageDTO);
    }

    @Test
    void add(){
        MessageDTO messageDTO = new MessageDTO();
        messageDTO.setUserId(1L);
        service.addMessageSubset(messageDTO);
    }


    @Test
    void select(){
        List<MessageVO> messageVOList = service.selectList();
        System.out.print(messageVOList);

    }

    @Test
    void delete(){
        Long id = 1L;
        List<MessageVO> messageVOList = service.selectList();
        System.out.println(messageVOList);
    }

    @Test
    void se(){
        Long id = 1L;
        List<MessageVO> messageVOList = messageMapper.selectPrentId(id);
        System.out.println(messageVOList);
    }
}
